/**
 * 
 */
package sob.netcode.refstyle;

/**
 * @author blackcore
 * @date 2013-11-15
 * @describe
 */
public class TrickySwap {

	public void SwapError(Point p1, Point p2) {
		p1.setA(100);
		p1.setB(100);
		Point temp = p1;
		p1 = p2;
		p2 = temp;		
	}

	public void SwapRight(Point p1,Point p2){
		p1.setA(100);
		p1.setB(100);
		Point tmp = new Point(p1.getA(), p1.getB());
		p1.setA(p2.getA());
		p1.setB(p2.getB());
		p2.setA(tmp.getA());
		p2.setB(tmp.getB());
	}
}

class Point {

	private int A;
	private int B;

	public Point(int a, int b) {
		A = a;
		B = b;
	}

	public int getA() {
		return A;
	}

	public int getB() {
		return B;
	}

	public void setA(int a) {
		A = a;
	}

	public void setB(int b) {
		B = b;
	}

}
